require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 1,["5"] = 1,["6"] = 3,["7"] = 3,["8"] = 3,["10"] = 9,["11"] = 10,["12"] = 11,["13"] = 8,["14"] = 14,["15"] = 15,["16"] = 16,["17"] = 17,["18"] = 17,["19"] = 17,["20"] = 17,["21"] = 18,["22"] = 19,["23"] = 19,["24"] = 19,["25"] = 19,["26"] = 19,["27"] = 20,["28"] = 20,["29"] = 20,["30"] = 20,["31"] = 20,["32"] = 20,["33"] = 20,["34"] = 20,["35"] = 20,["36"] = 20,["37"] = 21,["38"] = 21,["39"] = 21,["40"] = 21,["41"] = 21,["42"] = 22,["43"] = 22,["44"] = 22,["45"] = 22,["46"] = 23,["47"] = 23,["48"] = 23,["49"] = 23,["52"] = 15,["53"] = 14,["54"] = 5,["55"] = 3});
local ____exports = {}
local ____SelectUtil = require("solar.util.SelectUtil")
local SelectUtil = ____SelectUtil.default
____exports.default = __TS__Class()
local AddGoldByHaveAbilityOnPer5sState = ____exports.default
AddGoldByHaveAbilityOnPer5sState.name = "AddGoldByHaveAbilityOnPer5sState"
function AddGoldByHaveAbilityOnPer5sState.prototype.____constructor(self)
    local triggerHandle = CreateTrigger()
    TriggerRegisterTimerEventPeriodic(triggerHandle, 5)
    TriggerAddAction(triggerHandle, self.action)
end
function AddGoldByHaveAbilityOnPer5sState.prototype.action()
    SelectUtil.forAllUnits(function(____, unit)
        for abilityIdStr in pairs(____exports.default.config) do
            if GetUnitAbilityLevel(
                unit,
                FourCC(abilityIdStr)
            ) > 0 and IsUnitAliveBJ(unit) then
                local int = ____exports.default.config[abilityIdStr]
                AdjustPlayerStateBJ(
                    int,
                    GetOwningPlayer(unit),
                    PLAYER_STATE_RESOURCE_GOLD
                )
                CreateTextTagUnitBJ(
                    " +" .. I2S(int),
                    unit,
                    0,
                    10,
                    100,
                    84,
                    0,
                    0
                )
                SetTextTagVelocityBJ(
                    GetLastCreatedTextTag(),
                    100,
                    90
                )
                SetTextTagPermanent(
                    GetLastCreatedTextTag(),
                    false
                )
                SetTextTagLifespan(
                    GetLastCreatedTextTag(),
                    0.2
                )
            end
        end
    end)
end
AddGoldByHaveAbilityOnPer5sState.config = {}
____exports.default = AddGoldByHaveAbilityOnPer5sState
return ____exports
